<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!-->
<html>
<head>
  <meta charset="utf-8"/>

  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

  <title><?php echo Options::value('site_name') ?></title>

  <?php echo $this->html->css('reset') ?>
  <?php echo $this->html->css('style') ?>
  <?php echo $this->html->css('forms') ?>
  <?php echo $this->html->css('grid') ?>
  <?php echo $this->html->css('mobile') ?>

  <?php echo $this->javascript->link('jquery') ?>
  <?php echo $this->javascript->link('jquery.maskedinput.min') ?>

  <?php echo $this->html->css('ui-lightness/jquery-ui-1.8.16.custom.css') ?>
  <?php echo $this->javascript->link('jquery.ui.datepicker-pt-BR') ?>
  <?php echo $this->javascript->link('jquery-ui') ?>
  <?php echo $this->javascript->link('jquery-ui-timepicker-addon') ?>

  <?php echo $this->html->css(s::config()->get('theme_url') . '/fancybox/jquery.fancybox-1.3.4.css') ?>
  <?php echo $this->javascript->link(s::config()->get('theme_url') . '/fancybox/jquery.fancybox-1.3.4.pack.js') ?>

  <?php echo $this->html->css(s::config()->get('theme_url') . '/wysiwyg/jquery.wysiwyg.css') ?>
  <?php echo $this->javascript->link(s::config()->get('theme_url') . '/wysiwyg/jquery.wysiwyg.js') ?>

  <script>
  $(document).ready(function() {
    $('.lightbox').fancybox();
    $('.wysiwyg').wysiwyg();

    $(window).resize(function() {
      $('#left-column, #shadow').height($(window).height());
    }).trigger('resize');
  });

  $.timepicker.regional['pt-BR'] = {
    timeOnlyTitle: 'Hora',
    timeText: 'Hora',
    hourText: 'Horas',
    minuteText: 'Minutos',
    secondText: 'Segundos',
    millisecText: 'Milisegundos',
    currentText: 'Agora',
    closeText: 'Ok',
    ampm: false
  };

  $.timepicker.setDefaults($.timepicker.regional['pt-BR']);
  </script>
</head>

<body>
  <div id="left-column">
    <div id="header">
      <h1><a href="<?php echo s::response()->makeUrl('/admin') ?>"><?php echo Options::value('site_name') ?></a>
        <small><?php echo Options::value('site_tagline') ?></small>
      </h1>
    </div>

    <nav id="main-menu" class="menu-vertical">
      <?php echo $this->menu->show(s::getInstance()->menu()) ?>
    </nav>
  </div>

  <div id="right-column">
    <div id="shadow"></div>

    <div id="content">
      <nav id="user-menu">
        <?php if ($user = Account::getUser()) { ?>
        <ul class="menu tiled-list">
          <li class="menu-item list-item">Logado como <?php echo $user['user_email'] ?></li>
          <li class="menu-item list-item"><a href="<?php echo s::response()->makeUrl('/') ?>">ir para o site</a></li>
          <li class="menu-item list-item"><a href="<?php echo s::response()->makeUrl('/admin/account', array('action' => 'logout')) ?>">logout</a></li>
        </ul>
        <?php } ?>
      </nav>

      <?php if ($messages = s::getInstance()->warnings()) { ?>
      <div class="messages warnings">
        <ul>
        <?php foreach ($messages['*'] as $message) { ?>
          <li><?php echo $message ?></li>
        <?php } ?>
        </ul>
      </div>
      <?php } ?>

      <?php if ($messages = s::getInstance()->notices()) { ?>
      <div class="messages notices">
        <ul>
        <?php foreach ($messages['*'] as $message) { ?>
          <li><?php echo $message ?></li>
        <?php } ?>
        </ul>
      </div>
      <?php } ?>

      <?php echo $layout_content ?>
    </div>
  </div>
</body>
</html>